package com.newcoin.xgb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.newcoin.xgb.entity.XgbUsers;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UsersMapper extends BaseMapper<XgbUsers> {
    /**
     * 根据ID找path
     *
     * @param userId
     * @return
     */
    String getUserPath(@Param("userId") Long userId);
    /**
     * 获取团队有效人数
     *
     * @param path
     * @return
     */
    Integer getTeamEffectiveCount(@Param("path") String path);

    /**
     * 获取团队id
     *
     * @param path
     * @return
     */
    String getTeamUserId(@Param("path") String path);

    /**
     * 获取直推
     *
     * @param page
     * @param userId
     * @return
     */
    IPage<XgbUsers> getDirectPushUser(Page page, @Param("userId") Long userId);

    /**
     * 获取直推用户id
     *
     * @param userId
     * @return
     */
    String getDirectPushUserId(@Param("userId") Long userId);

    /**
     * 获取二层用户id
     *
     * @param directPushUserId
     * @return
     */
    String getSecondFloorUserId(@Param("directPushUserId") String directPushUserId);

    /**
     * 获取三层用户id
     *
     * @param secondFloorUserId
     * @return
     */
    String getThreeLayers(@Param("secondFloorUserId") String secondFloorUserId);

    /**
     * 获取用户id
     *
     * @param ids
     * @return
     */
    IPage<XgbUsers> getUserList(Page page, @Param("ids") String ids);

}
